import BuffUtil from '@/BuffUtil';

import ItemUtil from '@/ItemUtil';
export default class Item_巨熊利爪 {
    static id = 'C00P';
    static 名称: string = '巨熊利爪';
    static 描述: string = '攻击会得到持续加强，累加伤害';
    static 图标: string = 'ReplaceableTextures\\CommandButtons\\BTNDOCAdeptTraining.blp';
    static buffId: string = 'buff_item_juxionglizhua';
    static buffType: AppBuffType = {
        id: 'buff_item_juxionglizhua',
        name: Item_巨熊利爪.名称,
        ubertip: Item_巨熊利爪.描述,
        art: Item_巨熊利爪.图标,
        targetAttach: 'origin',
        targetArt: 'Abilities\\Spells\\Undead\\Sleep\\SleepSpecialArt.mdl',
        dur: 7,
        stackCountMax: -1,
    };
    static 释放(x: number, y: number, 来源?: unit, 目标?: unit, d?: any) {}
    constructor() {
        BuffUtil.registerBuffType(Item_巨熊利爪.buffType);
        EventManager.onBeforApplyAttack(Item_巨熊利爪.spellEffect);
    }
    static spellEffect(d: DamageEventData) {
        if (!ItemUtil.isUnitHasItem(d.source, Item_巨熊利爪.id)) return;
        let buff = BuffUtil.addBuff(d.target, Item_巨熊利爪.buffId, d.source);
        let dmg = 15 * buff.stackCount;
        d.initDamage += dmg;
    }
}
